package com.ff.neuropp.domain;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.Dto.PageDto;
import com.ff.neuropp.util.DateSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@ApiModel
@Table(name = "t_course_category")

/***
 *
 * 课程类型实体类
 */
public class CourseCategory extends PageDto {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(notes = "id编号", required = false)
    private Integer id;

    //名字
    @Column(name = "name", length = 20 )
    @ApiModelProperty(notes = "类型名称", required = true)
    private String name;

    //状态 status=0 下线，默认=1正常
    @Column(name = "status")
    @ApiModelProperty(notes = "status 状态 1、有效 0、无效", required = false)
    private Integer status = 1;

    //创建时间
    @Column(name = "create_date",updatable = false)
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @ApiModelProperty(notes = "创建时间", required = false)
    private Date createDate;

    //更新时间
    @Column(name = "update_date")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @ApiModelProperty(notes = "修改时间", required = false)
    private Date updateDate;
}
